package com.apes.autoparts.searcher.model;

import lombok.Getter;
import lombok.Setter;

import java.util.*;

@Getter
@Setter
public class EpcPartCodeParse {
    public static final String CONST_TABLE_NAME = "epc_part_code_parse";

    private String id;

    private String vin;

    private String pzcxid;

    private String qccpmc;

    private String epcVersion;

    private String menuName;

    private String partCode;

    private String partName;

    private String imageSN;

    private String imageUrl;

    private Map dept;

    private boolean parseFlag = false;

    private boolean errorFlag = false;

    private String partDescription;

    private List<Map> categories;

    private Map _creator;

    private Map _updater;


    /***
     * 格式化编译数据
     */
    public Set<String> formatParseData() {
        Set<String> parseSet = new HashSet<>();
        if( this.getPartDescription() != null ) {
            parseSet.addAll( Arrays.asList(this.getPartDescription().split(";"))); // 获取解析后的数据
        }
        return parseSet;
    }
}